#pragma once
#ifndef CARDSET_H
#define CARDSET_H
#include "Card.h"

namespace SHGame {
	using namespace System::Collections::Generic;
	/*
	A collection of cards
	Because M$ visual studios employs a GC-heap (with the carrot handles),
	it is apparently impossible to use their data structures from wihtin a
	non-mangaged (non carroted) ref class. So, in lue of fun data strcutures, this
	is backed by an array.
	*/
	public ref class CardSet
	{
	private:
		/*
		The list of cards in this set
		*/
		LinkedList<Card^> ^cards;
	public:
		/*
		Creates a new, empty, CardSet
		*/
		CardSet(void);

		/*
		Adds a new card to this set in the next empty spot.
		The internal array is expanded if necessary.
		Returns true if the card was added (the card may not have been
		added if it was already present in this set).
		*/
		bool add(Card ^card);

		/*
		Removes the given card from this set
		shifts over the elements in the array to fill the gap.
		returns true if the card was removed (meaning that the
		card was actually in this set).
		*/
		bool remove(Card ^card);

		/*
		checks if the given card is contained in this set
		returns true if the given card is contained.
		*/
		bool contains(Card ^card);

		/*
		checks if this set contains a trump card.
		returns true if there is a trump card in this set.
		*/
		bool hasTrump();

		/*
		checks if this set has a certain suit. This will not consider
		trump a member of another suit. For example, even if this set has
		the queen of spades (which is a trump) it is still possible that
		this hand will not have a spade.
		returns true if this has the given (fail) suit
		*/

		bool canFollowSuit(Card^);

		Card^ get(int i);

		LinkedList<Card^>^ followSuit(Card^);

		void sort();

		int GetFailSuits();
		int GetStrength();
		int Size();
		Card^ GetLongFail();
		Card^ GetShortFail();
		Card^ GetATrump();
		Card^ GetACard();
	};
}

#endif